package com.atguigu.gmall.feign.product;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.item.to.CategoryView;
import com.atguigu.gmall.model.item.to.SkuDetailTO;
import com.atguigu.gmall.model.product.entity.SkuInfo;
import com.atguigu.gmall.model.product.vo.SpuSaleInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author:lyd
 **/
@FeignClient(value = "service-product",contextId = "itemFeignClient")
@RequestMapping("/api/inner/product")
public interface SkuDetailItemFeignClient {

    @GetMapping("/categoryView/{category3Id}")
    Result<CategoryView> getCategoryView(@PathVariable("category3Id") Long category3Id);
    @GetMapping("/skuInfo/{skuId}")
    Result<SkuInfo> getSkuInfo(@PathVariable("skuId") Long skuId);
    @GetMapping("/skuPrice/{skuId}")
    Result<BigDecimal> getSkuPrice(@PathVariable("skuId") Long skuId);
    @GetMapping("/skuImage/{skuId}")
    Result<List<SkuDetailTO.SkuImageVo>> getSkuImageVoList(@PathVariable("skuId") Long skuId);
    @GetMapping("/spuSaleAttr/{spuId}/{skuId}")
    Result<List<SpuSaleInfoVo>> getSpuSaleAttrList(@PathVariable("spuId") Long spuId,
                                                   @PathVariable("skuId") Long skuId);
    @GetMapping("/valueSkuJson/{spuId}/")
    Result<String> getValueSkuJson(@PathVariable("spuId") Long spuId);
}

